package com.aizuda.boot.modules.business.permission.mapper;

import com.aizuda.boot.modules.business.permission.domain.entity.RolePermissionEntity;
import com.aizuda.boot.modules.business.permission.domain.request.GetPermissionPageVO;
import com.aizuda.boot.modules.business.permission.domain.response.PagePermissionVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author sangyirong
 * @version 1.0
 * @date 2025/5/15
 */
@Repository
public interface RolePermissionMapper extends BaseMapper<RolePermissionEntity> {

    IPage<PagePermissionVO> pagePermission(IPage<PagePermissionVO> page, GetPermissionPageVO vo, List<String> list);


    @Select("SELECT COUNT(1) FROM auth_role_data_isolation WHERE role_id = #{id}")
    Integer existRelByRoleId(Long id);
}
